package cn.wolfcode.shop.mapper;

import cn.wolfcode.shop.domain.SeckillOrder;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface SeckillOrderMappaer {
    @Select("select * from t_seckill_order where user_id = #{userId} and seckill_id = #{seckillId}")
    SeckillOrder selectBySeckillIdAndUserId(@Param("seckillId") Long seckillId, @Param("userId") Long userId);

    @Insert("INSERT INTO t_seckill_order (order_no, user_id, seckill_id) VALUES (#{orderNo},#{userId},#{seckillId})")
    void insert(SeckillOrder seckillOrder);
}
